using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Betarium.PotonEditor
{
	public partial class FullScrForm : Form
	{
		private Bitmap m_Image;

		public Bitmap Image
		{
			get { return m_Image; }
			set { m_Image = value; }
		}


		public FullScrForm()
		{
			InitializeComponent();
			Size = Screen.PrimaryScreen.Bounds.Size;
		}

		private void FullScrForm_Paint(object sender, PaintEventArgs e)
		{
			int nWidth = ClientSize.Width, nHeight = ClientSize.Height;
			if (m_Image.Width / (double)m_Image.Height >= ClientSize.Width / (double)ClientSize.Height)
			{
				nHeight = (int)(m_Image.Height / (double)m_Image.Width * ClientSize.Width);
			}
			else
			{
				nWidth = (int)(m_Image.Width / (double)m_Image.Height * ClientSize.Height);
			}
			e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
			e.Graphics.DrawImage(m_Image, new Rectangle(new Point(ClientSize.Width / 2 - nWidth / 2, ClientSize.Height / 2 - nHeight / 2), new Size(nWidth, nHeight)), new Rectangle(Point.Empty, m_Image.Size), GraphicsUnit.Pixel);
		}

		private void FullScrForm_MouseUp(object sender, MouseEventArgs e)
		{
			Dispose();
		}
	}
}